package com.xindacloud.sms.console.system.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xindacloud.sms.console.result.Result;
import com.xindacloud.sms.console.system.dto.SmsApiCategoryDTO;
import com.xindacloud.sms.console.system.entity.SmsApiCategory;
import com.xindacloud.sms.console.system.entity.SmsUiContent;
import com.xindacloud.sms.console.system.service.ISmsApiCategoryService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author czc
 * @since 2019-11-28
 */
@Api(tags = {"Api文档类别模块"})
@RestController
@RequestMapping("/api/v1/sms-api-category")
public class SmsApiCategoryController {

	@Autowired
	private ISmsApiCategoryService smsApiCategoryService;

	@ApiOperation(value = "获取Api文档类别",response=SmsApiCategory.class)
	@PostMapping(value = "/getSmsApiCategoryList")
	public Result getSmsApiCategoryList(@RequestBody SmsApiCategoryDTO smsApiCategoryDTO) {
	    return smsApiCategoryService.getSmsApiCategoryList(smsApiCategoryDTO);
	}
	
	@ApiOperation(value = "保存或修改Api文档类别",response=SmsApiCategory.class)
	@PostMapping(value = "/saveOrUpdateSmsApiCategory")
	public Result saveOrUpdateSmsApiCategory(@RequestBody SmsApiCategoryDTO smsApiCategoryDTO) {
	    return smsApiCategoryService.saveOrUpdateSmsApiCategory(smsApiCategoryDTO);
	}
	
	@ApiOperation(value = "删除Api文档类别",response=SmsApiCategory.class)
	@PostMapping(value = "/deleteSmsApiCategory")
	public Result deleteSmsApiCategory(@RequestBody SmsApiCategoryDTO smsApiCategoryDTO) {
	    return smsApiCategoryService.deleteSmsApiCategory(smsApiCategoryDTO);
	}

}
